// yb_shop/pages/web/index.js
var t = getApp(),
  a = t.requirejs("core");
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },
  //底部导航跳转
  menu_url: function (k) {
    a.menu_url(k, 2);
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (e) {

    console.log(e);

    a.setting();

    if (!e.url){
      a.toast('外链不能为空');
      setTimeout(function(){
        a.jump('',5);
      },1e3)
    }else{
      wx.setNavigationBarTitle({
        title: e.name ? decodeURIComponent(e.name) : '网页'
      }) 
      e.web_url = unescape(e.url);
      e.show=true;
      this.setData(e)
    }
  },
  /**
     * 用户点击右上角分享
     */
  onShareAppMessage: function (e) {
    var that = this.data;
    return {
      title: that.name,
      path: '/yb_shop/pages/web/index?name=' + that.name + '&url=' + that.url,
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }


  },
 
})